home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / xinetd / unpack-src < prev    next >
Encoding:
Text File  |  1993-06-28  |  1.7 KB  |  95 lines

  1. #!/bin/sh
  2.  
  3. #
  4. # (c) Copyright 1992 by Panagiotis Tsirigotis
  5. # All rights reserved.
  6. #
  7.  
  8. #
  9. # $Id: unpack-src,v 5.6 1993/01/08 01:51:32 panos Exp $
  10. #
  11.  
  12. script_name=`basename $0`
  13.  
  14. if test "$script_name" != "$0" -a "./$script_name" != "$0" ; then
  15.     echo This script must be executed from the directory where the tar files are
  16.     exit 1
  17. fi
  18.  
  19. lib_names="sio misc fsma str pset xlog"
  20.  
  21. #
  22. # If we have compressed files, uncompress them.
  23. #
  24. if test "`echo *.Z`" != '*.Z' ; then
  25.     echo Uncompressing *.Z
  26.     uncompress *.Z 
  27. fi
  28.  
  29. #
  30. # Verify that we have all the archives
  31. #
  32. haveall=yes
  33. for i in $lib_names xinetd
  34. do
  35.     if test "`echo $i.*.tar`" = "$i.*.tar" ; then
  36.         if test "$i" = "xinetd" ; then
  37.             echo xinetd is missing
  38.         else
  39.             echo Library $i is missing
  40.         fi
  41.         haveall=
  42.     fi
  43. done
  44. if test ! "$haveall" ; then exit 1 ; fi
  45.  
  46. for i in libs xinetd
  47. do
  48.     if test ! -d $i ; then
  49.         rm -f $i        # in case it is a file
  50.     else
  51.         echo -n "Directory $i exists; Delete it and proceed ? --> "
  52.         read ans
  53.         if test "$ans" != "yes" -a "$ans" != "y" ; then
  54.             echo "Exiting..."
  55.             exit 1
  56.         fi
  57.         echo -n "Deleting $i ... "
  58.         rm -rf $i
  59.         echo " DONE"
  60.     fi
  61. done
  62.  
  63. mkdir xinetd libs libs/man libs/include libs/lib
  64.  
  65. #
  66. # Create the necessary directories and untar the libraries
  67. #
  68. for i in $lib_names
  69. do
  70.     lib_dir=libs/$i
  71.     if test ! -d $lib_dir ; then
  72.         rm -f $lib_dir
  73.     else
  74.         rm -rf $lib_dir
  75.     fi
  76.     mkdir $lib_dir
  77.     lib_name=$i.*.tar
  78.     cp $lib_name $lib_dir
  79.     echo -n "Unpacking $i ..."
  80.     ( cd $lib_dir ; tar xf $lib_name )
  81.     echo " DONE"
  82. done
  83.  
  84. xtar=xinetd.*.tar
  85. cp $xtar xinetd
  86. echo -n "Unpacking xinetd ..."
  87. ( cd xinetd ; tar xf $xtar )
  88. echo " DONE"
  89.  
  90. echo Finished unpacking
  91. echo The tar files have been copied to the directories libs and xinetd.
  92. echo After you have successfully compiled xinetd you may want to delete 
  93. echo them from this directory.
  94.  
  95.